package com.puff.mapper;

import com.puff.annotation.AutoFill;
import com.puff.entity.Rider;
import com.puff.enumeration.OperationType;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface RiderMapper {

    /**
     * 新增骑手数据
     * @param rider
     */
    //@AutoFill(OperationType.INSERT)
    void insert(Rider rider);

    /**
     * 根据用户名查询骑手信息
     * @param username
     * @return
     */
    @Select("select * from rider where username = #{username}")
    Rider getByUsername(String username);

    /**
     * 根据id查询骑手信息
     * @param id
     * @return
     */
    @Select("select * from rider where id = #{id}")
    Rider getById(Long id);
}
